#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using webapp4U.DAL;
#endregion


namespace webapp4U.BOL
{
	 public class Chatlieu
	 {
	     #region Member Variables

	     private Int32 _chatlieuID;

	     private String _title;

	     private String _title_en;

	     private Int32 _displayOrder;

	     #endregion



	     #region Public Properties

	     public Int32 ChatlieuID
	     {
		     get { return _chatlieuID; }
		     set { _chatlieuID = value; }
	     }

	     public String Title
	     {
		     get { return _title; }
		     set { _title = value; }
	     }

	     public String Title_en
	     {
		     get { return _title_en; }
		     set { _title_en = value; }
	     }

	     public Int32 DisplayOrder
	     {
		     get { return _displayOrder; }
		     set { _displayOrder = value; }
	     }

	     #endregion

	     #region public static Methods
	     public static int Insert(Chatlieu obj)
	     {
		     ChatlieuDAL db = new ChatlieuDAL();
		     return db.Insert(obj);
	     }

	     public static bool Update(Chatlieu obj)
	     {
		     ChatlieuDAL db = new ChatlieuDAL();
		     return db.Update(obj);
	     }

	     public static bool Delete(Int32 ChatlieuID)
	     {
		     ChatlieuDAL db = new ChatlieuDAL();
		     return db.Delete(ChatlieuID); 
	     }

	     public static Chatlieu GetChatlieuByID(Int32 ChatlieuID)
	     {
		     ChatlieuDAL db = new ChatlieuDAL();
		     return db.GetChatlieuByID(ChatlieuID);
	     }

         public static string GetChatlieuNamByChatlieuID(Int32 ChatlieuID)
         {
             try
             {
                 Chatlieu obj = Chatlieu.GetChatlieuByID(ChatlieuID);
                 return (Globals.LangVietNam()) ? obj._title : obj._title_en;
             }
             catch
             { return ""; }
         }


	     //Get All Chatlieu
	     public static List<Chatlieu> GetAllChatlieu()
	     {
		     ChatlieuDAL db = new ChatlieuDAL();
		     return db.GetAllChatlieu(1, 10000);
	     }

	     //Get All Chatlieu
	     public static List<Chatlieu> GetAllChatlieu(int PageIndex, int PageSize)
	     {
		     ChatlieuDAL db = new ChatlieuDAL();
		     return db.GetAllChatlieu(PageIndex, PageSize);
	     }

	     // Get Count All records of Table  Chatlieu
	     public static int GetCountChatlieu()
	     {
		     ChatlieuDAL db = new ChatlieuDAL();
		     return db.GetCountChatlieu();
	     }



	     #endregion
	 }
}
